package com.ruoyi.app.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @author wqg 还款试算的处理类
 * @description
 * @date 2022/6/10
 */
@Component
public class TrialHandler {
    @Autowired
    private Map<String, ITrialService> trialServiceMap;

    public ITrialService getHandle(String serviceFlag) throws Exception {
        ITrialService serviceHandler = trialServiceMap.get(serviceFlag);
        if (null == serviceHandler) {
            throw new Exception("方法不存在～，@service需要声明！");
        }
        return serviceHandler;
    }

}
